<template>
    <div>
      <div class="banner" @click="handleBannerClick">
        <img class="banner-img" src="http://img1.qunarzz.com/sight/p0/201408/15/2f4c15c307f7d44fbf856177a7b6c5b3.jpg_600x330_0ad27bd3.jpg"/>
        <div class="banner-info">
          <div class="banner-title">
            黄河石林国家地质公园(AAAA景区)
          </div>
          <div class="banner-number">
            <span class="iconfont banner-icon" >&#xe67b;</span>
            24
          </div>
        </div>
      </div>
      <common-gallary :imgs="imgs" v-show="showGallary"
                      @closeGallary="handleCloseGallary"
                      class="common-gallary-class"
      ></common-gallary>
    </div>

</template>

<script>
import CommonGallary from '../../../common/gallary/gallary'

export default {
  name: 'Banner',
  components: {
    CommonGallary
  },
  data () {
    return {
      showGallary: false,
      imgs: ['http://img1.qunarzz.com/sight/p0/201408/15/2f4c15c307f7d44fbf856177a7b6c5b3.jpg_350x240_cd928dc2.jpg',
        'http://img1.qunarzz.com/sight/p0/201403/07/09d9c2368ba24d5049fefcfc023a26ec.jpg_350x240_69f566df.jpg']
    }
  },
  methods: {
    handleBannerClick () {
      this.showGallary = true
    },
    handleCloseGallary () {
      this.showGallary = false
    }
  }
}
</script>

<style lang="stylus" scoped>
  .banner {
    overflow: hidden;
    height: 0;
    padding-bottom: 55%;
    position: relative;
  }
  .banner-img {
    width: 100%;
  }
  .banner-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    line-height: .6rem;
    display: flex;
    color: white;
    background-image: linear-gradient(top, rgba(0,0,0,0), rgba(0,0,0,0.98));
  }
  .banner-title {
    flex: 1;
    font-size: .32rem;
    padding: 0 .2rem;
  }
  .banner-number {
    padding:0 .4rem;
    height: .32rem;
    line-height: .32rem;
    border-radius: .2rem;
    background: rgba(0,0,0,.8);
    font-size: .24rem;
    margin-top: .14rem;
  }
  .banner-icon {
    font-size: .24rem;
  }
  .common-gallary-class {
    z-index: 2;
  }
</style>
